async function getSyncTime(){
    return new Promise((resolve, reject) =>{
        try{
            let start_time = new Date().getTime();
            setTimeout(() => {
                let end_time = new Date().getTime();
                let data = end_time - start_time;
                resolve(data);
            }, 2000);
        }catch(e){
            reject(e);
        }
    })
}

async function getSyncData(){
    let time = await getSyncTime();
    let data = 'end - start = ' + time;
    return data;
}

async function getData(){
    let data = await getSyncData();
    console.log(data);
}

getData();
